{{range .configList}}
<source>
  @type tail
  path_key file_path
  tag docker.{{ $.containerId }}.{{ .Name }}
  path {{ .HostDir }}/{{ .File }}
  format {{ .Format }}

{{if .FormatConfig}}
{{range $key, $value := .FormatConfig}}
{{ $key }} {{ $value }}
{{end}}
{{end}}
  pos_file /pilot/pos/{{ $.containerId }}.{{ .Name }}.pos
  refresh_interval 1
</source>

<filter docker.{{ $.containerId }}.{{ .Name }}>
@type record_transformer
enable_ruby true
<record>
host "#{Socket.gethostname}"
log_name ${record["file_path"].split('/')[10]}
{{range $key, $value := .Tags}}
{{ $key }} {{ $value }}
{{end}}

{{range $key, $value := $.container}}
{{ $key }} {{ $value }}
{{end}}


</record>
</filter>
{{end}}


